package com.gismore.demo.web

import com.gismore.demo.db.dao.CustomerRepository
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RestController

/**
 * Created by lei on 2017/5/22.
 */
@RestController
class HelloController (val repo: CustomerRepository) {
    @GetMapping("/hello")
    fun hello() = "Hello there,SpringBoot and Kotlin!"

    @GetMapping("/")
    fun findAll() = repo.findAll()

    @GetMapping("/{name}")
    fun findByLastName(@PathVariable name: String) = repo.findByLastName(name)
}